#include "VM.h"
#include "VMBinaryCode.h"
//#include "VMBCHelper.h"
//#include "vm_instructions.h"

#include "array/Array.hpp"
#include "io/FileInputStream.h"
#include "util/Util.h"

#if defined(_WIN32)&&defined (_DEBUG)
#include "vld.h"
#endif

using namespace yzrilyzr_vmp;
using namespace yzrilyzr_io;
using namespace yzrilyzr_array;
using namespace yzrilyzr_util;

int main(){
	FileInputStream fis(u8"D:\\Projects\\Java\\libs\\VMPCompiler\\test.sb");
	auto code=Util::read(fis);
	VMBinaryCode binCode(code);
	//VMBinaryCode binCode(0,0);
	VM vm;
	vm.loadModule("test", binCode);
	VMValue arg0;
	arg0.f32=3.0f;
	VMValue args[1]={arg0};
	VMValue val=vm.callFunction("test", "testFunc", args, 1);
	std::cout << val.f32 << std::endl;
	return 0;
}